{include file='public/head'}
<body>
<style type="text/css" media="screen">
    header {
        color: black;
    }

    .layui-form-label {
        width: 100px
    }

    .layui-input-block {
        margin-left: 130px
    }
</style>


<div class="x-body">
    <form class="layui-form" id='mainForm' method="post" action="params.html">

        <div class="layui-form-item">
            <label class="layui-form-label">账号或者账号id</label>
            <div class="layui-input-block">
                <input type="text" id="user" name="user" value="{$info.user}" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">密码</label>
            <div class="layui-input-block">
                <input type="text" id="password" name="password" value="{$info.password}" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">App Name</label>
            <div class="layui-input-block">
                <input type="text" id="app_name" name="app_name" value="{$info.app_name}" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">App Key</label>
            <div class="layui-input-block">
                <textarea id="app_key" name="app_key" class="layui-textarea">{$info.app_key}</textarea>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">Secret Key</label>
            <div class="layui-input-block">
                <textarea id="secret_key" name="secret_key" class="layui-textarea">{$info.secret_key}</textarea>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">Token</label>
            <div class="layui-input-block">
                <textarea id="token" name="token" class="layui-textarea">{$info.token}</textarea>
            </div>
        </div>

        <div class="layui-form-item">
            <div>
                <input type="hidden" id="id" name="id" value="{$Think.get.id}">
                <button style="width: 100%" class="layui-btn" lay-submit="" lay-filter="toSubmit">提交保存</button>
            </div>
        </div>

    </form>
</div>
</body>
{include file='public/foot'}
<script type="text/javascript">

    $(document).ready(function () {
        var form = layui.form;
        var layer = layui.layer;

        var options = {
            type: 'post',           //post提交
            dataType: "json",        //json格式
            data: {},    //如果需要提交附加参数，视情况添加
            clearForm: false,        //成功提交后，清除所有表单元素的值
            resetForm: false,        //成功提交后，重置所有表单元素的值
            cache: false,
            async: false,          //同步返回
            success: function (data) {
                if (data.code == 0) {
                    layer.msg(data.msg);
                } else {
                    layer.msg(data.msg, {icon: 1, time: 500}, function () {
                        $("#reset").click();
                        x_admin_close();
                        parent.location.reload();
                    });
                }
                //服务器端返回处理逻辑
            },
            error: function (XmlHttpRequest, textStatus, errorThrown) {
                layer.msg('操作失败:服务器处理失败');
            }
        };

        // bind form using 'ajaxForm'
        $('#mainForm').ajaxForm(options).submit(function (data) {
        });
        form.render();
    });
</script>
</html>
